public class ThreadDemo6 {
    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    System.out.println("hello thread");
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }  
            }
        }, "myThread");//myThread 就是在操作系统中可以查看到的名字
        thread.start();
    }
}
